package top.whk0710.java_study;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;

public class GenericOut {

	public static void main(String[] args) {
		
		
		
		ArrayList<Integer> list = new ArrayList<Integer>();
		list.add(123);

		try {
			list.getClass().getMethod("add", Object.class).invoke(list, "cachu");
			System.out.println(list);
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			e.printStackTrace();
		} catch (SecurityException e) {
			e.printStackTrace();
		}
	}
}

class D{
	
	public D(){
		
	}
}
class C extends D{
	public C(){
		super();
	}
}